import 'dart:convert';
import 'dart:io';

import 'package:flutter_test/flutter_test.dart';

Future readFileAwaitFor() async {
  print('start');
  var config = File('config.txt');
  Stream<List<int>> inputStream = config.openRead();
  print('start1');
  var lines = inputStream.transform(utf8.decoder).transform(LineSplitter());
  try {
    print('start2');
    await for (var line in lines) {
      print('Got ${line.length} characters from stream');
    }
    print('file is now closed');
  } catch (e) {
    print(e);
  }
}

main() {
  readFileAwaitFor();
//  test("test", () async {
//    readFileAwaitFor();
//  });
}
